<style >
    .list-container{
        
    }

</style>
<!--引用外部样式-->
<!-- <link href="../normalize.8.0.1.css"/> -->
<template>
    <div>
        <nav class="navbar navbar-default">
            <div class="container-fluid">
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">RapJS</a>
                    <p class="navbar-text navbar-right">快速构建基于Vue的秒开边用边下载的流应用</p>
                    <form class="navbar-form navbar-left" role="search">
                        <div class="form-group">
                            <input v-model="item" type="text" class="form-control">
                        </div>
                        <button type="submit" class="btn btn-success" @click="add">Add in end</button>
                        <button type="submit" class="btn btn-danger" @click="remove">Remove end</button>
                    </form>
                </div>
            </div>
        </nav>
        <div class="list-container">
            <mobile_item v-for="(item,index) in list" :index="index" :content="item"></mobile_item>
        </div>
    </div>
</template>
<script>
//这里定义组件
Rap.define(['/mobile/item'],{
    data: function(){
        return {
            list:['item data','item data','item data','item data','item data','item data'],
            item: "item data"
        }
    },
    created:function () {

    },
    init:function () {
    },
    methods:{
        add:function(){
            this.list.push(this.item);
        },
        remove:function(){
            if(this.list.length<1) return;
            this.list.splice(this.list.length-1,1);
        }
    }
})
</script>